%this function calculates the median and the maximum of the square of each
%of the matrices supplied in varargin

%created by Ricardo Mejia-Alvarez
%University of Illinois at Urbana-Champaign
%Urbana, IL. 04/06/2010

function [UU , UUmax] = medianDep(varargin)

N = length(varargin);
UU = zeros(1,N);
UUmax = zeros(1,N);

for k = 1 : N

        U = cell2mat( varargin(k) );
        U = U - median(median(U));
        U = U.^2;
        UU(k) = median(median(U));
        UUmax(k) = max(max(U));

end

end